package com.gitee.feizns.itrip.personal.utils.service;

import javax.servlet.http.HttpServletRequest;

/**
 * @author feizns
 * @since 2019/1/13 0013
 */
public interface AliPayService {

    /**
     * 默认的字符编码
     */
//    String DEFAULT_CHARSET = "UTF-8";
    String DEFAULT_CHARSET = "UTF-8";

    /**
     * 默认的签名方式
     */
    String DEFAULT_SIGN_TYPE = "RSA2";

    /**
     * 默认产品编码
     */
    String PRODUCT_CODE = "FAST_INSTANT_TRADE_PAY";

    /**
     * 生产环境支付宝网关
     */
    String PRODUCT_GATEWAY_URL = "https://openapi.alipay.com/gateway.do";

    /**
     * 开发环境支付宝网关
     */
    String DEV_GATEWAY_URL = "https://openapi.alipaydev.com/gateway.do";

    /**
     * 默认的数据格式
     */
    String DEFAULT_FORMAT = "json";

    /**
     * 向支付宝发送付款请求
     * @param outTradeNo
     * @param totalAmount
     * @param subject
     * @param body
     * @return
     */
    String send(String outTradeNo, String totalAmount, String subject, String body);

    /**
     * 调用SDK验证签名
     * @param req
     * @return
     */
    boolean rsaCheckV1(HttpServletRequest req);

}
